// --------------------------------------------------------------------------------------------
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
// 
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// 
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
// 
// <remarks>
// Generated by IDLImporter from file nsIApplicationCacheChannel.idl
// 
// You should use these interfaces when you access the COM objects defined in the mentioned
// IDL/IDH file.
// </remarks>
// --------------------------------------------------------------------------------------------
namespace Gecko
{
	using System;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.CompilerServices;
	
	
	/// <summary>
    /// Interface implemented by channels that support application caches.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("6FA816B1-6D5F-4380-9704-054D0908CFA3")]
	public interface nsIApplicationCacheChannel : nsIApplicationCacheContainer
	{
		
		/// <summary>
        /// Interface used by objects that can be associated with an
        /// application cache.
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new nsIApplicationCache GetApplicationCacheAttribute();
		
		/// <summary>
        /// Interface used by objects that can be associated with an
        /// application cache.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new void SetApplicationCacheAttribute([MarshalAs(UnmanagedType.Interface)] nsIApplicationCache aApplicationCache);
		
		/// <summary>
        /// TRUE when the resource came from the application cache. This
        /// might be false even there is assigned an application cache
        /// e.g. in case of fallback of load of an entry matching bypass
        /// namespace.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetLoadedFromApplicationCacheAttribute();
		
		/// <summary>
        /// When true, the channel will ask its notification callbacks for
        /// an application cache if one is not explicitly provided.  Default
        /// value is true.
        ///
        /// NS_ERROR_ALREADY_OPENED will be thrown if set after AsyncOpen()
        /// is called.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetInheritApplicationCacheAttribute();
		
		/// <summary>
        /// When true, the channel will ask its notification callbacks for
        /// an application cache if one is not explicitly provided.  Default
        /// value is true.
        ///
        /// NS_ERROR_ALREADY_OPENED will be thrown if set after AsyncOpen()
        /// is called.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetInheritApplicationCacheAttribute([MarshalAs(UnmanagedType.U1)] bool aInheritApplicationCache);
		
		/// <summary>
        /// When true, the channel will choose an application cache if one
        /// was not explicitly provided and none is available from the
        /// notification callbacks.  Default value is false.
        ///
        /// This attribute will not be transferred through a redirect.
        ///
        /// NS_ERROR_ALREADY_OPENED will be thrown if set after AsyncOpen()
        /// is called.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetChooseApplicationCacheAttribute();
		
		/// <summary>
        /// When true, the channel will choose an application cache if one
        /// was not explicitly provided and none is available from the
        /// notification callbacks.  Default value is false.
        ///
        /// This attribute will not be transferred through a redirect.
        ///
        /// NS_ERROR_ALREADY_OPENED will be thrown if set after AsyncOpen()
        /// is called.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetChooseApplicationCacheAttribute([MarshalAs(UnmanagedType.U1)] bool aChooseApplicationCache);
		
		/// <summary>
        /// A shortcut method to mark the cache item of this channel as 'foreign'.
        /// See the 'cache selection algorithm' and CACHE_SELECTION_RELOAD
        /// action handling in nsContentSink.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void MarkOfflineCacheEntryAsForeign();
		
		/// <summary>
        /// Set offline application cache object to instruct the channel
        /// to cache for offline use using this application cache.
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIApplicationCache GetApplicationCacheForWriteAttribute();
		
		/// <summary>
        /// Set offline application cache object to instruct the channel
        /// to cache for offline use using this application cache.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetApplicationCacheForWriteAttribute([MarshalAs(UnmanagedType.Interface)] nsIApplicationCache aApplicationCacheForWrite);
	}
}
